cdee3fdd5cd71487425cb1816d0a2c3a8c7b1ae9,software/base/src/test/java/brooklyn/entity/java/VanillaJavaAppTest.java,VanillaJavaAppTest,testJavaSystemProperties,#,93

Before Change



    @Test(groups={"WIP", "Integration"})
    public void testJavaSystemProperties() throws Exception {
        VanillaJavaApp javaProcess = new VanillaJavaApp(MutableMap.builder()
                .put("parent", app)
                .put("main", "my.Main")
                .put("classpath", ImmutableList.of("c1", "c2"))
                .put("args", ImmutableList.of("a1", "a2"))
                .build());
        javaProcess.setConfig(UsesJava.JAVA_SYSPROPS, ImmutableMap.of("fooKey", "fooValue", "barKey", "barValue"));
        // TODO: how to test: launch standalone app that outputs system properties to stdout? Probe via JMX?
    }

After Change



    @Test(groups={"WIP", "Integration"})
    public void testJavaSystemProperties() throws Exception {
        final VanillaJavaApp javaProcess = app.addChild(EntitySpec.create(VanillaJavaApp.class)
            .configure("main", "my.Main").configure("classpath", ImmutableList.of("c1", "c2"))
            .configure("args", ImmutableList.of("a1", "a2")));
        ((EntityLocal)javaProcess).setConfig(UsesJava.JAVA_SYSPROPS, ImmutableMap.of("fooKey", "fooValue", "barKey", "barValue"));
        // TODO: how to test: launch standalone app that outputs system properties to stdout? Probe via JMX?
    }